# SPDX-FileCopyrightText: none
# SPDX-License-Identifier: BSD-3-Clause



########### next target ###############
set(kontact_knotesplugin_PART_SRCS
  knotes_plugin.cpp
  knotes_part.cpp
  summarywidget.cpp
  knotesiconview.cpp
  knoteslistwidgetsearchline.cpp
  knoteswidget.cpp
  knoteseditdialog.cpp
  knotesselectdeletenotesdialog.cpp
)

qt_add_dbus_adaptor(kontact_knotesplugin_PART_SRCS org.kde.kontact.KNotes.xml knotes_part.h KNotesPart)
qt_add_dbus_interfaces(kontact_knotesplugin_interface_SRCS org.kde.kontact.KNotes.xml)

ecm_qt_declare_logging_category(kontact_knotesplugin_PART_SRCS HEADER knotes_kontact_plugin_debug.h IDENTIFIER KNOTES_KONTACT_PLUGIN_LOG CATEGORY_NAME org.kde.pim.knoteskontactplugin
        DESCRIPTION "knotes (knotes kontact plugin)"
        OLD_CATEGORY_NAMES log_knoteskontactplugin
        EXPORT KNOTES
    )



add_library(kontact_knotesplugin MODULE ${kontact_knotesplugin_PART_SRCS} ${kontact_knotesplugin_interface_SRCS} )
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
    set_target_properties(kontact_knotesplugin PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries(kontact_knotesplugin
                      knotesprivate
                      KF5::CalendarCore
                      KF5::CalendarUtils
                      KF5::KontactInterface
                      notesharedprivate
                      KF5::DNSSD
                      KF5::Mime
                      KF5::KCMUtils
                      KF5::AkonadiWidgets
                      KF5::AkonadiNotes
                      KF5::ItemViews
                      KF5::Contacts
)

########### install files ###############

set(kcmknotessummary_PART_SRCS kcmknotessummary.cpp )
configure_file(knotesplugin.json.cmake ${CMAKE_CURRENT_BINARY_DIR}/knotesplugin.json )
add_library(kcmknotessummary MODULE ${kcmknotessummary_PART_SRCS})
target_link_libraries(kcmknotessummary  KF5::PimCommonAkonadi KF5::AkonadiNotes KF5::ConfigWidgets KF5::I18n)


install(TARGETS kcmknotessummary DESTINATION ${KDE_INSTALL_PLUGINDIR}/pim${QT_MAJOR_VERSION}/kcms/summary)


install(TARGETS kontact_knotesplugin DESTINATION ${KDE_INSTALL_PLUGINDIR}/pim${QT_MAJOR_VERSION}/kontact)
install(FILES knotes_part.rc DESTINATION ${KDE_INSTALL_KXMLGUIDIR}/knotes)
install(FILES org.kde.kontact.KNotes.xml DESTINATION ${KDE_INSTALL_DBUSINTERFACEDIR})

